<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="oneroom.admin.oneroom.roomModel" %>
<%@ page import="oneroom.user.subway.subwayModel" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.HashMap"%>
<%@ page import="java.net.*" %>    
<%@ page import="java.util.Date" %>    
<%@ page import="java.io.*" %>  
<jsp:useBean id="dao" scope="page" class="oneroom.admin.oneroom.roomDao" />
<jsp:useBean id="codeDao" scope="page" class="oneroom.admin.code.codeDao" />
<jsp:useBean id="subdao" scope="page" 	class="oneroom.user.subway.subwayDao" />
<% 

	//기본 세트 값 시작
	String searchGubn = request.getParameter("searchGubn") == null ? "" : request.getParameter("searchGubn");
	String searchValue = request.getParameter("searchValue") == null ? "" : request.getParameter("searchValue");
	int     giSelectPage  	= Integer.parseInt(request.getParameter("txtSelectPage") == null ? "0" :request.getParameter("txtSelectPage"));			//현재 선택된 페이지 저장
	int     giSelectBlock 	= Integer.parseInt(request.getParameter("txtSelectBlock") == null ? "0" :request.getParameter("txtSelectBlock"));			//현재 선택된 블락페이지 저장
	//기본 세트 값 끝

	String oneroom_seq = request.getParameter("oneroom_seq") == null ? "" : request.getParameter("oneroom_seq");
	roomModel model = dao.getView(oneroom_seq);
	
	//기본 세트 값 끝
	HashMap	returnMap	= new HashMap();
	returnMap		= dao.getReportCnt(oneroom_seq);
	int report_cnt = (int)Double.parseDouble(returnMap.get("report_cnt").toString());
	int finish_cnt = (int)Double.parseDouble(returnMap.get("finish_cnt").toString());
	
	//코드 값을 코드 명으로 변경
	model.setRoomkind(codeDao.getDtlName("500",model.getRoomkind()));
	String subWay = model.getSubway1();
	model.setSubway1(codeDao.getDtlName("001",model.getSubway1()));
	model.setSubway2(codeDao.getDtlName(subWay,model.getSubway2()));
	model.setHeating(codeDao.getDtlName("300",model.getHeating()));
	model.setAirconditioning(codeDao.getDtlName("301",model.getAirconditioning()));
	int university = Integer.parseInt(model.getUniversity1() == "" ? "0" :model.getUniversity1()) ;
	university = 400 + university;
	model.setUniversity1(codeDao.getDtlName("400",model.getUniversity1()));
	model.setUniversity2(codeDao.getDtlName(university+"",model.getUniversity2()));
	
	String[] furniture = model.getFurniture1().split(",");
	String furnitureName = "";
	if(!model.getFurniture1().equals("")){	
		for(int i = 0; i<furniture.length; i++){
			furnitureName = furnitureName+codeDao.getDtlName("302",furniture[i])+" ";
		}
	}
	model.setFurniture1(furnitureName);
	
	String[] appliances = model.getAppliances1().split(",");
	String appliancesName = "";
	if(!model.getAppliances1().equals("")){		
		for(int i = 0; i<appliances.length; i++){
			appliancesName = appliancesName+codeDao.getDtlName("303",appliances[i])+" ";
		}
	}
	model.setAppliances1(appliancesName);
	
	String[] kitchen = model.getKitchen1().split(",");
	String kitchenName = "";
	if(!model.getKitchen1().equals("")){	
		for(int i = 0; i<kitchen.length; i++){
			kitchenName = kitchenName+codeDao.getDtlName("304",kitchen[i])+" ";
		}
	}
	model.setKitchen1(kitchenName);
	
	String[] security = model.getSecurity1().split(",");
	String securityName = "";
	if(!model.getSecurity1().equals("")){
		for(int i = 0; i<security.length; i++){
			securityName = securityName+codeDao.getDtlName("305",security[i])+" ";
		}
	}
	model.setSecurity1(securityName);
	
	//String[] facility = model.getFacility1().split(",");
	//String facilityName = "";
	//for(int i = 0; i<facility.length; i++){
	//	facilityName = facilityName+codeDao.getDtlName("306",facility[i])+" ";
	//}
	//model.setFacility1(facilityName);
	
	
	
	/* 리스트 시작*/
	
	//검색 부분
	String subway 	= request.getParameter("subway") 	== null ? "" : request.getParameter("subway");
	String maincode = request.getParameter("maincode") 	== null ? "" : request.getParameter("maincode");
	String sort 		= request.getParameter("sort") 		== null ? "date" : request.getParameter("sort");
	int     giCount       	= 0;			//리스트 for문 break문에 사용
	int     giRecordcnt   	= 0;			//리스트의 카운터에 사용
	int     giPageSize    	= 10;  			// 한페이지에 나타내고자 하는 List수
	int     giBlockSize   	= 10;   		// Block의 수
	int     giCurPage     	= 1;   			// 현재 Page
	int     giCurBlock    	= 0;   			// 현재 Block
	int     giStartPos    	= 0;   			// 시작 List 위치
	int     giTotPage     	= 0;   			// 총 Page수
	int     giTotBlock    	= 0;   			// 총 Block수
	//  넘겨온 값 받기(List페이지 관련)...
	if ( giSelectPage  >  0 ) { 			// 선택된 Page값이 있을경우....     
		giCurPage  = giSelectPage;   	// 현재Page = 선택된Page 
		giCurBlock = giSelectBlock;  	// 블락page = 선택된 블락 page
	}
	//쿼리를 돌려서 가지고 오는 값
	
	List roomList  = subdao.getSubway( subway, 
									 sort,			
									 giSelectPage, 
									 giPageSize);	
	if (roomList.size() > 0 ) {
		//전체 게시물 수
		giRecordcnt = subdao.getCount(subway);  			// 총 list 수
	}
	if (giRecordcnt > 0) {  // 조건에 맞는 값이 있으면....
		giTotPage  = giRecordcnt / giPageSize;
		if (giRecordcnt % giPageSize != 0) {
			giTotPage = giTotPage + 1;			// 총 Page수를 구한다...
		}
		giTotBlock = giTotPage / giBlockSize;
		if (giTotPage % giBlockSize != 0) {
			giTotBlock = giTotBlock + 1;		// 총 Block수를 구한다...
		}
	}
%>
<%    
    String query = model.getAddress1()+model.getAddress2()+model.getAddress3()+model.getAddress4()+model.getAddress5();// request.getParameter("query");
    //String query = "인천시남구주안3동759-21은하빌라가동";
    //out.println("query:"+query);
    if (query == null) query="";      
    query = query.replaceAll(" ", "");    
    int c;    
    query  = new String(query.getBytes("UTF-8"),"UTF-8");       
    URL mapXmlUrl = new URL("http://map.naver.com/api/geocode.php?key=7f515c767b2d31063b747392d101657c&query="+query );   
    //URL mapXmlUrl = new URL("http://map.naver.com/api/geocode.php?key=44e907fce4453e321f0e235d623dd126&query="+query );   
    URLConnection mapCon = mapXmlUrl.openConnection();    
    int len = mapCon.getContentLength();    
   String inputSt = "";    
       
    if (len > 0)    
    {    
        InputStream input = mapCon.getInputStream();    
        InputStreamReader inputst = new InputStreamReader(input, "euc-kr");    
         
        int i = len;    
        while (((c = inputst.read()) != -1) && (--i > 0)){    
            inputSt = inputSt + (char)c;    
        }    
       input.close();    
   }   
    int pre_len = 0 ;           
    String x1 = "";    
    String y1 = "";    
       
    while( inputSt.indexOf("</item>") > -1 ){    
        int first = 1;    
        x1 = inputSt.substring( inputSt.indexOf("<x>")+3, inputSt.indexOf("</x>") ) ;    
        y1 = inputSt.substring( inputSt.indexOf("<y>")+3, inputSt.indexOf("</y>") ) ;    
        inputSt = inputSt.substring( inputSt.indexOf("</item>")+7, inputSt.length() ) ;    
           
        if ( pre_len == inputSt.length())    
            break;    
        pre_len=inputSt.length();    
        int lent = inputSt.length();    
          
    }   
       
%>  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>원룸몬스터</title>
<link href="/room/css/all.css" rel="stylesheet" type="text/css" />
<script src="/room/script/swfobject_modified.js" type="text/javascript"></script>
<script src="/room/script/common.js" type="text/javascript"></script>
<script src="/room/script/jquery-1.3.2.min.js" type="text/javascript" ></script>
<script type="text/javascript" src="http://map.naver.com/js/naverMap.naver?key=7f515c767b2d31063b747392d101657c"></script> 
<!-- script type="text/javascript" src="http://map.naver.com/js/naverMap.naver?key=44e907fce4453e321f0e235d623dd126"></script>-->
   
<script type="text/javascript">
<!--
$(document).ready(function(){
	
	$('#btReport').click(function() {
<%	if (session.getAttribute("id") != null &&	((String)session.getAttribute("id")).equals("") == false){%>
		document.getElementById("gubun").value = "R";
		document.getElementById("frmView").action = "area_dbx.jsp";
		document.getElementById("frmView").submit();
<%}else{%>
		alert("로그인 하십시오.");
<%}%>

	});
	$('#btFinish').click(function() {
<%	if (session.getAttribute("id") != null &&	((String)session.getAttribute("id")).equals("") == false){%>		
		document.getElementById("gubun").value = "F";
		document.getElementById("frmView").action = "area_dbx.jsp";
		document.getElementById("frmView").submit();
		<%}else{%>
		alert("로그인 하십시오.");
<%}%>				
	});	
});
function goView(oneroomseq){
	document.frmView.oneroom_seq.value = oneroomseq;
	document.frmView.submit();
}
var goList = function(){
	document.getElementById("subway").value = "<%=subway%>";
	document.getElementById("frmView").action = "sub_list.jsp";
	document.getElementById("frmView").submit();
};
var image_over= new Array();
image_over[1]= new Image();
image_over[1].src = '/download/<%=model.getPhoto1_big() %>?name=<%=model.getPhoto1_big() %>&kind=img';
image_over[2]= new Image();
image_over[2].src = '/download/<%=model.getPhoto2_big() %>?name=<%=model.getPhoto2_big() %>&kind=img';
image_over[3]= new Image();
image_over[3].src = '/download/<%=model.getPhoto3_big() %>?name=<%=model.getPhoto3_big() %>&kind=img';
image_over[4]= new Image();
image_over[4].src = '/download/<%=model.getPhoto4_big() %>?name=<%=model.getPhoto4_big() %>&kind=img';
image_over[5]= new Image();
image_over[5].src = '/download/<%=model.getPhoto5_big() %>?name=<%=model.getPhoto5_big() %>&kind=img';
image_over[6]= new Image();
image_over[6].src = '/download/<%=model.getPhoto6_big() %>?name=<%=model.getPhoto6_big() %>&kind=img';

function img_over(part){
	image_center.src=image_over[part].src;
}
function display(no){
    for(var i=1; i<=3; i++){
        document.getElementById("content"+i).style.display="none";
    }
    document.getElementById("content"+no).style.display="block";
}
function display2(no){
    for(var i=1; i<=2; i++){
        document.getElementById("charter_type"+i).style.display="none";
    }
    document.getElementById("charter_type"+no).style.display="block";
}
//-->
</script>
</head>

<body>
<div align="center"> 

 <div id="content">

<!----------------왼쪽---------------->  
  <%@ include file="/room/common/left.jsp" %>
<!----------------왼쪽끝---------------->  


<!----------------가운데 시작----------------> 
 <div id="rgt">
  <div id="con01">
   <div class="top bb1"><img src="/room/img/txt_top.gif" /></div>
   
   <div id="sch-adress">
     <div><img src="/room/img/title_view.gif"/></div>
     <div class="bg_view">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="ball" width="457" height="336"><img src="/download/<%=model.getPhoto1_big() %>?name=<%=model.getPhoto1_big() %>&kind=img"  name="image_center" width="457" height="336" /></td>
    <td width="14">&nbsp;</td>    
    <td align="right">
     <div><%if(!model.getPhoto2_small().equals("")){ %><a href="#" onmouseover="img_over(1);" ><img src="/download/<%=model.getPhoto1_small() %>?name=<%=model.getPhoto1_small() %>&kind=img" width="100" height="50"/></a><%}else{ %><img src="/room/img/thum_sample02.jpg" width="100" height="50"/><%} %></div>
     <div class="pt7"><%if(!model.getPhoto2_small().equals("")){ %><a href="#" onmouseover="img_over(2);"><img src="/download/<%=model.getPhoto2_small() %>?name=<%=model.getPhoto2_small() %>&kind=img" width="100" height="50"/></a><%}else{ %><img src="/room/img/thum_sample02.jpg" width="100" height="50"/><%} %></div>
     <div class="pt7"><%if(!model.getPhoto3_small().equals("")){ %><a href="#" onmouseover="img_over(3);"><img src="/download/<%=model.getPhoto3_small() %>?name=<%=model.getPhoto3_small() %>&kind=img" width="100" height="50"/></a><%}else{ %><img src="/room/img/thum_sample02.jpg" width="100" height="50"/><%} %></div>
     <div class="pt7"><%if(!model.getPhoto4_small().equals("")){ %><a href="#" onmouseover="img_over(4);"><img src="/download/<%=model.getPhoto4_small() %>?name=<%=model.getPhoto4_small() %>&kind=img" width="100" height="50"/></a><%}else{ %><img src="/room/img/thum_sample02.jpg" width="100" height="50"/><%} %></div>
     <div class="pt7"><%if(!model.getPhoto5_small().equals("")){ %><a href="#" onmouseover="img_over(5);"><img src="/download/<%=model.getPhoto5_small() %>?name=<%=model.getPhoto5_small() %>&kind=img" width="100" height="50"/></a><%}else{ %><img src="/room/img/thum_sample02.jpg" width="100" height="50"/><%} %></div>
     <div class="pt7"><%if(!model.getPhoto6_small().equals("")){ %><a href="#" onmouseover="img_over(6);"><img src="/download/<%=model.getPhoto6_small() %>?name=<%=model.getPhoto6_small() %>&kind=img" width="100" height="50"/></a><%}else{ %><img src="/room/img/thum_sample02.jpg" width="100" height="50"/><%} %></div>
    </td>
  </tr>
</table>

     </div>

<div><img src="/room/img/bg_box3_bottom.gif" /></div>
</div>
<% if(report_cnt >= 2 || finish_cnt >= 2){ %>
<div class="list">
  <table width="595" border="0" cellspacing="0" cellpadding="0">
  <tr>
  <%if(report_cnt >= 2){ %>
    <td><strong><font color="red">허위매물 가능성이 높습니다.</font></strong></td>
  <%}%>
  <%if(finish_cnt >= 2){ %>
    <td><strong><font color="red">거래완료 가능성이 높습니다.</font></strong></td>
  <%}%> 
  </tr>
</table>
</div>
<%} %>
<div class="list">
<table  width="167" border="0" cellspacing="0" cellpadding="0">
  <tr>
<!--     <td><a href="javascript:display('1');" class="d"><p class="btn_b87" id="tap01">기본정보</p></a></td>
    <td><a href="javascript:display('2');" class="b"><p class="btn_b87" id="tap02">옵션정보</p></a></td>
    <td><a href="javascript:display('3');" class="d"><p class="btn_b87" id="tap03">소개</p></a></td>
     -->
    <td><p class="btn_b87" id="tap01">기본정보</p></td>
  </tr>
</table>  
<!-- <div id="content1" style="display: block;"> -->
<table width="595" border="0" cellspacing="0" cellpadding="0">
<col width="15%" />
<col width="35%" />
<col width="15%" />
<col width="35%" />
  <tr>
    <td class="ac fw bt2 bb1 h30 bg_g">주소</td>
    <td colspan="3" class="bt2 bb1 h30 pl10 ">
    <%=model.getAddress1() %>
	<%=model.getAddress2() %>
	<%=model.getAddress3() %>
	<%//=model.getAddress4() %>
	<%//=model.getAddress5() %>
    </tr>
  <tr>
    <td class="ac fw bb1 h30 bg_g">방수</td>
    <td class="bb1 h30 pl10"><%=model.getRoomnumber() %> 개</td>
    <td class="ac fw bb1 h30 bg_g">매물종류</td>
    <td class="bb1 h30 pl10"><%=model.getRoomkind() %></td>
  </tr>
  <tr>
    <td class="ac fw bb1 h30 bg_g">평수</td>
    <td class=" bb1 h30 pl10"><%=model.getRoomarea() %>평</td>
    <td class="ac fw bb1 h30 bg_g">임대형태</td>
    <td class="bb1 h30 pl10">
    <input type="radio" name="charter" value="J" disabled="disabled" <%if(model.getCharter().equals("J")){%>checked="checked"<%} %> onclick="display2('1');"/>전세 
	<input type="radio" name="charter" value="W" disabled="disabled" <%if(model.getCharter().equals("W")){%>checked="checked"<%} %> onclick="display2('2');"/>월세
	</td>
  </tr>
  <tr>
    <td class="ac fw bb1 h30 bg_g">층</td>
    <td class="bb1 h30 pl10"><%=model.getRoomfloor1() %> / <%=model.getRoomfloor2() %></td>
    <td class="ac fw bb1 h30 bg_g"><span id="charter_name"><%if(model.getCharter().equals("J")){%>전세<%}else{ %>월세<%} %></span></td>
    <td class="bb1 h30 pl10">
	<div id="charter_type1"  style="display:<%if(model.getCharter().equals("J")){%>block<%}else{ %>none<%} %>">
	<%=model.getRoommoney() %> 만원
	</div>
	<div id="charter_type2"  style="display:<%if(model.getCharter().equals("W")){%>block<%}else{ %>none<%} %>">
	보증 : <span class="c_org fs11"><strong><%=model.getRoommonth1() %></strong> 만원 </span><br/> 
	월세 : <span class="c_org fs11"><strong><%=model.getRoommonth2() %></strong> 만원 </span>
	</div>					
	</td>
  </tr>
  </tr>
  <tr>
    <td class="ac fw bb1 h30 bg_g">주차</td>
    <td class="bb1 h30 pl10"><%=model.getCar() %>대</td>
    <td class="ac fw bb1 h30 bg_g">관리비</td>
    <td class="bb1 h30 pl10" ><%=model.getManagemoney() %> 만원</td>				    
  </tr>
  <tr>
    <td class="ac fw bb1 h30 bg_g">거래방식</td>
    <td colspan="3" class=" bb1 h30 pl10"><%if(model.getRoomoption().equals("D")){out.print("<font color='#ff00ff'>직거래</font>");}else if(model.getRoomoption().equals("M")){out.print("<font color='#008000'>반값중개</font>");}else if(model.getRoomoption().equals("G")){out.print("<font color='#808000'>일반중개</font>");} %>&nbsp;</td>
  </tr>  
  <tr>
    <td class="ac fw bb1 h30 bg_g">지하철</td>
    <td colspan="3" class="bb1 h30 pl10 ">
    <%=model.getSubway1() %> <%if(!model.getSubway1().equals("")){ %><%=model.getSubway2() %>역 <%=model.getSubway3() %>분거리<%} %>	&nbsp;
  </tr>				  
  <tr>
    <td class="ac fw bb1 h30 bg_g">대학교</td>
    <td class="bb1 h30 pl10">
    <%=model.getUniversity1() %>
	<%=model.getUniversity2() %>
	<%=model.getUniversity3() %>
	&nbsp;
	</td>
    <td class="ac fw bb1 h30 bg_g">입주일자</td>
    <td class="bb1 h30 pl10">
	<%=model.getLease() %> : 
	<%=model.getLeaseyear() %>
	<%=model.getLeasemonth() %>
	<%=model.getLeaseday() %>
	</td>
  </tr>		
</table>
</div>
<!-- <div id="content2" style="display: none;">-->
<div class="list">
<table  width="167" border="0" cellspacing="0" cellpadding="0">
  <tr>
<!--     <td><a href="javascript:display('1');" class="d"><p class="btn_b87" id="tap01">기본정보</p></a></td>
    <td><a href="javascript:display('2');" class="b"><p class="btn_b87" id="tap02">옵션정보</p></a></td>
    <td><a href="javascript:display('3');" class="d"><p class="btn_b87" id="tap03">소개</p></a></td>
     -->
    <td><p class="btn_b87" id="tap02">옵션정보</p></td>
  </tr>
</table>
<table width="595" border="0" cellspacing="0" cellpadding="0">
<col width="15%" />
<col width="35%" />
<col width="15%" />
<col width="35%" />
  <tr>
     <td class="ac fw bt2 bb1 h30 bg_g">난방시설 </td><td class="bt2 bb1 h30 pl10 "><%=model.getHeating() %></td>
     <td class="ac fw bt2 bb1 h30 bg_g">냉방시설 </td><td class="bt2 bb1 h30 pl10 "><%=model.getAirconditioning() %></td>
  </tr>
  <tr>
     <td class="ac fw bb1 h30 bg_g">가구</td>
     <td colspan="3" class="bb1 h30 pl10">
    <%=model.getFurniture1() %>&nbsp;&nbsp;
	<%=model.getFurniture2() %>&nbsp;&nbsp;
	<%=model.getFurniture3() %>&nbsp;&nbsp;
	<%=model.getFurniture4() %>&nbsp;&nbsp;
	</td>
  </tr>
  <tr>
     <td class="ac fw bb1 h30 bg_g">가전</td>
     <td colspan="3" class="bb1 h30 pl10">
	<%=model.getAppliances1() %>&nbsp;&nbsp;
	<%=model.getAppliances2() %>&nbsp;&nbsp;
	<%=model.getAppliances3() %>&nbsp;&nbsp;
	<%=model.getAppliances4() %>&nbsp;&nbsp;
	<%=model.getAppliances5() %>&nbsp;&nbsp;
	<%=model.getAppliances6() %>&nbsp;&nbsp;
	<%=model.getAppliances7() %>&nbsp;&nbsp;
     </td>
  </tr>
  <tr>
     <td class="ac fw bb1 h30 bg_g">주방/욕실</td>
     <td colspan="3" class="bb1 h30 pl10">  
	<%=model.getKitchen1() %>&nbsp;&nbsp;
	<%=model.getKitchen2() %>&nbsp;&nbsp;
	<%=model.getKitchen3() %>&nbsp;&nbsp;
	<%=model.getKitchen4() %>&nbsp;&nbsp;
	<%=model.getKitchen5() %>&nbsp;&nbsp;
     </td>
  </tr>
  <tr>
     <td class="ac fw bb1 h30 bg_g">무료</td>
     <td colspan="3" class="bb1 h30 pl10">
	<%=model.getSecurity1() %>&nbsp;&nbsp;
	<%=model.getSecurity2() %>&nbsp;&nbsp;
	<%=model.getSecurity3() %>&nbsp;&nbsp;
	<%=model.getSecurity4() %>&nbsp;&nbsp;
	<%=model.getSecurity5() %>&nbsp;&nbsp;
	<%=model.getSecurity6() %>&nbsp;&nbsp;
	</td>
  </tr>
  <!-- tr>
     <td class="bb1 h30 pl10">▶ 주변시설 :  
	<%//=model.getFacility1() %>
	<%//=model.getFacility2() %>
	<%//=model.getFacility3() %>
	<%//=model.getFacility4() %>
	<%//=model.getFacility5() %>
	</td>
  </tr> -->
</table>
</div>
<div class="list">
<table  width="167" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><p class="btn_b87" id="tap03">소개</p></td>
  </tr>
</table> 
<table width="595" border="0" cellspacing="0" cellpadding="0">
<col width="15%" />
<col width="35%" />
<col width="15%" />
<col width="35%" />
  <tr>
    <td class="ac fw bt2 bb1 h30 bg_g">제목</td>
    <td colspan="3" class="bt2 bb1 h30 pl10 ">
    <%=model.getTitle() %>
    </tr>
  <tr>
    <td class="ac fw bb1 h30 bg_g">작성자</td>
    <td  class=" bb1 h30 pl10"><%=model.getPerson() %></td>
     <td class="ac fw bb1 h30 bg_g">연락처</td>
    <td class="ac bb1 h30"><%=model.getTel1() %> - <%=model.getTel2() %> - <%=model.getTel3() %></td>
  </tr>
  <tr>
     <td colspan="4" class="bb1 h30 pl10 lh pt10 pb10"><%=model.getContent().replaceAll("\n","</br>") %>
	</td>
   </tr>
  <tr>
    <td colspan="3" class="bb1 h30 pl10 ac pt10 pb10"> 허위매물 또는 내용오류 발견시 모두를 위해 클릭해주세요.</td>
    <td class="bb1 h30 pl10 ac pt10 pb10"><a class="d" href="#" id="btReport" title="허위 신고일 경우 불이익을 받을수 있습니다."><p class="btn_g80">불량매물신고</p></a></td>
  </tr>
  <tr>
    <td colspan="3" class="bb1 h30 pl10 ac pt10 pb10">거래가 완료 된 물건일 경우 모두를 위해 클릭해주세요.</td>
    <td class="bb1 h30 pl10 ac pt10 pb10"><a class="d" href="#" id="btFinish" title="매매가 완료된 매물일 경우 해당 버튼을 클릭하십시오."><p class="btn_g80">거래완료신고</p></a></td>
  </tr>
</table>   
</div>  

<!-----------매물정보------------------>
<div class="list">
<!--  div><img src="/room/img/tab_buyinfo.gif" width="87" height="25" /></div -->
<table  width="167" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><p class="btn_b87">위치정보</p></td>
  </tr>
</table>  
<table width="595" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="ac fw bt2 bb1 h30 bg_g">
    <div id='mapContainer' style='width:300px;height:300px'></div>   
	<script type="text/javascript">   
	<!--  

	     	 
	var mapObj = new NMap(document.getElementById('mapContainer'),595,400);   
	var x1 = <%=x1%>;   
	var y1 = <%=y1%>;   
	mapObj.setCenterAndZoom(new NPoint(x1,y1),3);  
	  
	var iconUrl = 'http://static.naver.com/maps2/icons/pin_spot2.png';
	var icon = new NIcon(iconUrl, new NSize(32, 30));
	//var marker = new NMark(new NPoint(x1,y1), new NIcon(iconUrl, new NSize(35, 18)));
	var marker = new NMark(new NPoint(<%=x1%>, <%=y1%>), icon);
	mapObj.addOverlay(marker);

	//-->   
	</script> 
	</td>				
    </tr>
</table>
</div>
<!-- 
<div class="list">
<div><img src="/room/img/title_another.gif"  /></div>
<%
		//if(roomList != null && roomList.size() > 0){
		//	giCount  = 1;
		//	giRecordcnt = giRecordcnt - ( giCurPage -1 ) * giPageSize;	
//		//	giStartPos = ((giCurPage - 1) * giPageSize) + 1;
	%>
	<%//for(int i=0; i<roomList.size(); i++){ %>
	<%// addressModel admodel = (addressModel)roomList.get(i);%>
 <div class="pt10 pb10 bb1">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
   <col width="109px;" />
   <col width="329px;" />
   <col width="100px;" />
   <col width="62px;" />
   
  <tr>
    <td class="thum01"><a href="javascript:goView('<%//=admodel.getOneroom_seq()%>')"><%//if(admodel.getPhoto1_main().equals("1")){ %>
			<img src="/download/<%//=admodel.getPhoto1_small() %>?name=<%//=admodel.getPhoto1_small() %>&kind=img" />
		<%//}else if(admodel.getPhoto1_main().equals("2")){ %>
			<img src="/download/<%//=admodel.getPhoto2_small() %>?name=<%//=admodel.getPhoto2_small() %>&kind=img" />
		<%//}else if(admodel.getPhoto1_main().equals("3")){ %>
			<img src="/download/<%//=admodel.getPhoto3_small() %>?name=<%//=admodel.getPhoto3_small() %>&kind=img" />
		<%//}else if(admodel.getPhoto1_main().equals("4")){ %>
			<img src="/download/<%//=admodel.getPhoto4_small() %>?name=<%//=admodel.getPhoto4_small() %>&kind=img" />
		<%//}else if(admodel.getPhoto1_main().equals("5")){ %>
			<img src="/download/<%//=admodel.getPhoto5_small() %>?name=<%//=admodel.getPhoto5_small() %>&kind=img" />
		<%//}else if(admodel.getPhoto1_main().equals("6")){ %>
			<img src="/download/<//=admodel.getPhoto6_small() %>?name=<%//=admodel.getPhoto6_small() %>&kind=img" />
		<%//} %></a></td>
    <td valign="top" class="pt5 pl10"><span class="fw"><%//=admodel.getTitle() %></span>~<br /><%//=admodel.getContent() %>
    </td>
    <td valign="top" class="pt5 fw">전세<span class="c_org fs11"> <%//=admodel.getRoommoney() %></span><br />
월세 <span class="c_org fs11"> <%//=admodel.getRoommonth1() %>/<%//=admodel.getRoommonth2() %></span> </td>
    <td valign="top" class="pt5"><//=admodel.getCreatedate() %></td>
  </tr>
</table>
</div>

<%
	//	giCount = giCount + 1;
	//	giRecordcnt = giRecordcnt - 1;
	%>
	<%//} %>
	<%//}else{ %>
<div class="pt10 pb10 bb1">
	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
	   <col width="100%" />
	  <tr>
	  	<td>
	  		검색된 매물 정보가 없습니다.
	  	</td>
	  </tr>
	</table>
</div>

	<%//} %>

</div>
 -->
<div class="list"> 
 <table class="pr15 pt15" align="right" width="120" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td> <a class="d" href="javascript:goList();" ><p class="btn_b47">목록</p></a></td>
    <td> <a class="d" href="#top" ><p class="btn_b47">위로</p></a></td>
  </tr>
</table>
</div>
</div>  
<!----------------가운데 끝---------------->
<!----------------오른쪽 시작---------------->    
  <%@ include file="/room/common/right.jsp" %>  
<!----------------오른쪽 끝---------------->
</div>
<!-------------푸터영역----------> 
<%@ include file="/room/common/footer.jsp" %> 
<form action="sub_view.jsp" method="post" id="frmView" name="frmView">
	<input type="hidden" name="subway" value="<%=subway %>" id="subway" />
	<input type="hidden" name="maincode" value="<%=maincode %>" id="maincode" />
	<input type="hidden" name="sort" value="<%=sort %>"/>	
	<input type="hidden" name="oneroom_seq" id="oneroom_seq" value="<%=model.getOneroom_seq() %>"/>
	<input type="hidden" name="gubun" id="gubun" />
</form>
</body>
</html>
